 
 
 import InfoCard from "./components/info-card"
 // import {registerRendererByType} from "@colys/amis-renderer-widget"
 
 var headTarget = document.getElementsByTagName('head')[0]
 
 var cssArr = ['/static/amis/sdk.css', '/static/amis-render-widgets.css']
   for (var i in cssArr) {
     var path = cssArr[i];     
     const css = document.createElement('link')
     css.rel = 'stylesheet'
     css.type = 'text/css'
     css.href = path
     headTarget.appendChild(css)
   }
    
 
 
 //加载amis sdk.js
 const hm = document.createElement('script')
 hm.type = 'text/javascript'
 hm.src = "/static/amis/sdk.js";
 headTarget.appendChild(hm) 
 hm.onload = function(res) {  
 	// window.amis.on = function(name, callback) {
 	// 	window.addEventListener("amis-load", callback);
 	// }
 	//regist widget
 	
 	
 }
 
 window.onload = function() {
 	// setTimeout(()=>{
		//加载widgets
 	const widgetHm = document.createElement('script')
 	widgetHm.type = 'text/javascript'
 	widgetHm.src = "/static/amis-render-widgets.js";
 	// widgetHm.src = "http://192.168.2.175:1024/index.js";
 	headTarget.appendChild(widgetHm)	
	widgetHm.onload=function(){
	 //触发amis-load
		var event = document.createEvent("HTMLEvents");
		event.initEvent("amis-load", true, true);
		window.dispatchEvent(event)
	}
	
	
	// },500)
 	
 	
 	
 		
 	
 };